<?php

class Main_Form_Registration extends Zend_Form
{

    public function init()
    {
        $this->setName ( 'registration' );
        $this->setMethod ( 'post' );
		$isEmptyMessage = 'Value of this filed can\'t be empty';
		$firstName = new Zend_Form_Element_Text ( 'firstName' );
		$firstName->setLabel ( 'First Name:' )->setRequired ( true )
				->addFilter ( 'StripTags' )->addFilter ( 'StringTrim' )
				->addValidator ( 'NotEmpty', true, array ('messages' => array ('isEmpty' => $isEmptyMessage ) ) );
		
		$lastName = new Zend_Form_Element_Text ( 'lastName' );
		$lastName->setLabel ( 'Last Name:' )->setRequired ( true )
				->addFilter ( 'StripTags' )->addFilter ( 'StringTrim' )
				->addValidator ( 'NotEmpty', true, array ('messages' => array ('isEmpty' => $isEmptyMessage ) ) );
		
		$email = new Zend_Form_Element_Text ( 'email' );
		$email->setLabel ( 'Email:' )->setRequired ( true )
				->addFilter ( 'StripTags' )->addFilter ( 'StringTrim' )
				->addValidator ( 'NotEmpty', true, array ('messages' => array ('isEmpty' => $isEmptyMessage ) ) )
				->addValidator('EmailAddress');
		
				
		$password = new Zend_Form_Element_Password ( 'password' );
		$password->setLabel ( 'Password:' )->setRequired ( true )
				->addFilter ( 'StripTags' )->addFilter ( 'StringTrim' )->
				addValidator ( 'NotEmpty', true, array ('messages' => array ('isEmpty' => $isEmptyMessage ) ) );
		
		$confirmPassword = new Zend_Form_Element_Password ( 'confirmPassword' );
		$confirmPassword->setLabel( 'Confirm Password' )->addValidator('Identical', false, array('token' => 'password'));

		$submit = new Zend_Form_Element_Submit ( 'registration' );
		$submit->setAttrib('class', 'btn');
		$submit->setLabel ( 'Register' );
		
		$this->addElements ( array ($firstName, $lastName, $email, $password, $confirmPassword, $submit ) );


	
    }


}

